package ESP.Dao.Impl;

import java.util.List;
import java.util.Map;

import org.springframework.jdbc.core.support.JdbcDaoSupport;


import com.alibaba.fastjson.JSONArray;


public abstract class IBaseDao extends JdbcDaoSupport{
	/**
	 * sql语句
	 */
	protected static StringBuffer sqlBuffer;
	/**
	 * sql语句
	 */
	protected static String sql = null;
	
	/**
	 * 转换list2json
	 */
	protected abstract JSONArray toJson(List<Map<String,Object>> list);
	/**
	 * 转换map2json
	 */
	protected abstract JSONArray toJson(Map<String, Object> map);
	/**
	 * 设置返回信息
	 */
	protected abstract Map<String, String> setReturnInfo(Map<String, String> message,
			String returnFlag, String returnMsg);
	/**
	 * 根据user_id获取用户角色
	 */
	protected abstract String getRoleByUser_id(String user_id);
	/**
	 * 查询全部(查询字典表用到)
	 */
	public abstract List<Map<String,Object>> queryAll(String tableName);
	/**
	 * 传入sql返回List
	 */
	public abstract List<Map<String,Object>> querySqlForList(String sql);
	/**
	 * 传入sql返回Int
	 */
	public abstract int querySqlForInt(String sql);
	/**
	 * 传入sql更新 返回Int
	 */
	public abstract int updateSqlForInt(String sql);
}
